<template>
    <div class="panel">
        <div><button @click="getRourcesList('hello', $event)">获取视频内容列表</button></div>
        <div>
            <p>{{ length }}</p>
        </div>
        <div class="link-list" v-if="flag" v-for="(record, index) in data.records" :key="record.vid">
            <span class="link-text"><a :href="record.url"> {{ index + 1 }}.{{ record.fileName }} </a></span>
            <span class="link-image"><img :src="record.image" alt=""></span>
        </div>
    </div>
</template>

<style>
.panel {
    text-align: center;
}

.link-list {
    display: block;
}

.link-list .link-text {
    display: block;
}

img {
    width: 35%;
    height: 35%;
}

a:link {
    text-decoration: none;
    color: #000000;
}

/* unvisited link */
a:visited {
    text-decoration: none;
    color: #000000;
}

/* visited link */
a:hover {
    text-decoration: none;
    color: #0000ff;
}

/* mouse over link */
a:active {
    text-decoration: none;
    color: #000000;
}

/* selected link */
</style>

<script>
export default {
    methods: {
        getRourcesList(msg, e) {
            this.flag = !this.flag
            e.target.innerHTML = "折叠视频内容列表"
        }
    },
    computed: {
        length() {
            return this.data.records.length > 0 ? "Yes" : "NO"
        }

    },
    data() {
        return {
            "flag": false,
            "code": 0,
            "message": "成功",
            "data": {
                "pageIndex": 1,
                "pageSize": 1000,
                "totalPage": 1,
                "count": 4,
                "isUserPurchased": null,
                "records": [
                    {
                        "image": "https://cdn.pixabay.com/photo/2016/12/23/12/40/night-1927265_1280.jpg",
                        "seriesId": "",
                        "editionId": "6603c85060675f00018be2f3",
                        "volumeId": "6603c87adada9700014080ff",
                        "catalogId": "6603c89860675f00018be2f4",
                        "seriesName": null,
                        "editionName": "新标准初中（修订版）",
                        "volumeName": "七年级上册",
                        "materialName": "新标准初中（修订版）",
                        "versionName": "新标准初中（修订版）七年级上册",
                        "levelName": "七年级上册",
                        "moduleName": null,
                        "unitName": null,
                        "resourceId": null,
                        "url": "https://vod.unischool.cn/c05f11925ab471efb91b5420848d0102/2fa21ec834d1ecb4ab65c064c82e8717-ld.mp4",
                        "vid": "c05f11925ab471efb91b5420848d0102",
                        "browseUrl": null,
                        "fltrpUrl": null,
                        "fltrpSize": 0,
                        "fltrpMd5": null,
                        "courseWareId": "66bd76c0ac454900013af118",
                        "fileName": "《英语》（新标准）初中修订版七年级上册Starter微课第1课时.mp4",
                        "name": null,
                        "fileSize": 0,
                        "createTime": 1723692736378,
                        "updateTime": 1723700560815,
                        "type": "VIDEO",
                        "size": 268770138,
                        "format": "mp4",
                        "resourceType": "29",
                        "volumeIdAppend": null,
                        "volumePrice": 0.0,
                        "sort": 1,
                        "courseWareDownloadType": 1
                    },
                    {
                        "image": "https://cdn.pixabay.com/photo/2022/03/24/19/57/the-sheep-7089786_1280.jpg",
                        "seriesId": "",
                        "editionId": "6603c85060675f00018be2f3",
                        "volumeId": "6603c87adada9700014080ff",
                        "catalogId": "6603c89860675f00018be2f4",
                        "seriesName": null,
                        "editionName": "新标准初中（修订版）",
                        "volumeName": "七年级上册",
                        "materialName": "新标准初中（修订版）",
                        "versionName": "新标准初中（修订版）七年级上册",
                        "levelName": "七年级上册",
                        "moduleName": null,
                        "unitName": null,
                        "resourceId": null,
                        "url": "https://vod.unischool.cn/a0d363725ab571efbfc54531948c0102/f6edcba0c87012b04837b49a6f769f34-ld.mp4",
                        "vid": "a0d363725ab571efbfc54531948c0102",
                        "browseUrl": null,
                        "fltrpUrl": null,
                        "fltrpSize": 0,
                        "fltrpMd5": null,
                        "courseWareId": "66bd76c0ac454900013af119",
                        "fileName": "《英语》（新标准）初中修订版七年级上册Starter微课第2课时.mp4",
                        "name": null,
                        "fileSize": 0,
                        "createTime": 1723692736386,
                        "updateTime": 1723700537237,
                        "type": "VIDEO",
                        "size": 196393171,
                        "format": "mp4",
                        "resourceType": "29",
                        "volumeIdAppend": null,
                        "volumePrice": 0.0,
                        "sort": 2,
                        "courseWareDownloadType": 1
                    },
                    {
                        "image": "https://cdn.pixabay.com/photo/2015/04/18/13/24/image-728739_1280.jpg",
                        "seriesId": "",
                        "editionId": "6603c85060675f00018be2f3",
                        "volumeId": "6603c87adada9700014080ff",
                        "catalogId": "6603c89860675f00018be2f4",
                        "seriesName": null,
                        "editionName": "新标准初中（修订版）",
                        "volumeName": "七年级上册",
                        "materialName": "新标准初中（修订版）",
                        "versionName": "新标准初中（修订版）七年级上册",
                        "levelName": "七年级上册",
                        "moduleName": null,
                        "unitName": null,
                        "resourceId": null,
                        "url": "https://vod.unischool.cn/60f3343e5ab671efbd586733a78e0102/cf3fbdcc5c0bc852b4ded2e069f9dbd8-ld.mp4",
                        "vid": "60f3343e5ab671efbd586733a78e0102",
                        "browseUrl": null,
                        "fltrpUrl": null,
                        "fltrpSize": 0,
                        "fltrpMd5": null,
                        "courseWareId": "66bd76c0ac454900013af11a",
                        "fileName": "《英语》（新标准）初中修订版七年级上册Starter微课第3课时.mp4",
                        "name": null,
                        "fileSize": 0,
                        "createTime": 1723692736391,
                        "updateTime": 1723700513935,
                        "type": "VIDEO",
                        "size": 93645480,
                        "format": "mp4",
                        "resourceType": "29",
                        "volumeIdAppend": null,
                        "volumePrice": 0.0,
                        "sort": 3,
                        "courseWareDownloadType": 1
                    },
                    {
                        "image": "https://cdn.pixabay.com/photo/2024/05/15/01/02/cat-8762401_1280.png",
                        "seriesId": "",
                        "editionId": "6603c85060675f00018be2f3",
                        "volumeId": "6603c87adada9700014080ff",
                        "catalogId": "6603c89860675f00018be2f4",
                        "seriesName": null,
                        "editionName": "新标准初中（修订版）",
                        "volumeName": "七年级上册",
                        "materialName": "新标准初中（修订版）",
                        "versionName": "新标准初中（修订版）七年级上册",
                        "levelName": "七年级上册",
                        "moduleName": null,
                        "unitName": null,
                        "resourceId": null,
                        "url": "https://vod.unischool.cn/80a47ca25ab671ef9d785017f0f80102/ff6828ff8c687fcc0fae52f7e6d3e8d1-ld.mp4",
                        "vid": "80a47ca25ab671ef9d785017f0f80102",
                        "browseUrl": null,
                        "fltrpUrl": null,
                        "fltrpSize": 0,
                        "fltrpMd5": null,
                        "courseWareId": "66bd76c0ac454900013af11b",
                        "fileName": "《英语》（新标准）初中修订版七年级上册Starter微课第4课时.mp4",
                        "name": null,
                        "fileSize": 0,
                        "createTime": 1723692736396,
                        "updateTime": 1723700499272,
                        "type": "VIDEO",
                        "size": 64962560,
                        "format": "mp4",
                        "resourceType": "29",
                        "volumeIdAppend": null,
                        "volumePrice": 0.0,
                        "sort": 4,
                        "courseWareDownloadType": 1
                    }
                ],
                "timestamp": 1727146919541,
                "notEmpty": true
            },
            "success": true
        }
    }
}
</script>
